package com.free.system.service.impl;

import java.util.List;
import com.free.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.free.system.mapper.FreeMemberRecordMapper;
import com.free.system.domain.FreeMemberRecord;
import com.free.system.service.IFreeMemberRecordService;
import com.free.common.core.text.Convert;

/**
 * 会员数据拉取记录Service业务层处理
 * 
 * @author Sophia
 * @date 2025-02-25
 */
@Service
public class FreeMemberRecordServiceImpl implements IFreeMemberRecordService 
{
    @Autowired
    private FreeMemberRecordMapper freeMemberRecordMapper;

    /**
     * 查询会员数据拉取记录
     * 
     * @param id 会员数据拉取记录主键
     * @return 会员数据拉取记录
     */
    @Override
    public FreeMemberRecord selectFreeMemberRecordById(Long id)
    {
        return freeMemberRecordMapper.selectFreeMemberRecordById(id);
    }

    /**
     * 查询会员数据拉取记录列表
     * 
     * @param freeMemberRecord 会员数据拉取记录
     * @return 会员数据拉取记录
     */
    @Override
    public List<FreeMemberRecord> selectFreeMemberRecordList(FreeMemberRecord freeMemberRecord)
    {
        return freeMemberRecordMapper.selectFreeMemberRecordList(freeMemberRecord);
    }

    /**
     * 新增会员数据拉取记录
     * 
     * @param freeMemberRecord 会员数据拉取记录
     * @return 结果
     */
    @Override
    public int insertFreeMemberRecord(FreeMemberRecord freeMemberRecord)
    {
        freeMemberRecord.setCreateTime(DateUtils.getNowDate());
        return freeMemberRecordMapper.insertFreeMemberRecord(freeMemberRecord);
    }

    /**
     * 修改会员数据拉取记录
     * 
     * @param freeMemberRecord 会员数据拉取记录
     * @return 结果
     */
    @Override
    public int updateFreeMemberRecord(FreeMemberRecord freeMemberRecord)
    {
        freeMemberRecord.setUpdateTime(DateUtils.getNowDate());
        return freeMemberRecordMapper.updateFreeMemberRecord(freeMemberRecord);
    }

    /**
     * 批量删除会员数据拉取记录
     * 
     * @param ids 需要删除的会员数据拉取记录主键
     * @return 结果
     */
    @Override
    public int deleteFreeMemberRecordByIds(String ids)
    {
        return freeMemberRecordMapper.deleteFreeMemberRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员数据拉取记录信息
     * 
     * @param id 会员数据拉取记录主键
     * @return 结果
     */
    @Override
    public int deleteFreeMemberRecordById(Long id)
    {
        return freeMemberRecordMapper.deleteFreeMemberRecordById(id);
    }
}
